ruby:
  form_url = new_or_create_route? ? app_scheme_channels_path(scheme.app, scheme) : app_scheme_channel_path(app, scheme, channel)

.col-md-12
  .card
    = simple_form_for(channel, url: form_url, data: { action: 'turbo:submit-end->modal#close' }) do |f|
      .card-body
        = f.error_notification

        = f.input :scheme_id, as: :hidden, input_html: { value: params[:scheme_id] }
        = f.input :name, required: true
        = f.input :device_type, collection: Channel.device_types, label_method: :last, value_method: :first, selected: channel.device_type ? channel.device_type : Channel.device_types.first
        = f.input :download_filename_type, collection: Channel.download_filename_types, label_method: :last, value_method: :first, selected: channel.download_filename_type ? channel.download_filename_type : Channel::DEFAULT_DOWNLOAD_FILENAME_TYPE
        = f.input :bundle_id
        = f.input :git_url
        = f.input :slug
        = f.input :password, input_html: { type: 'input', value: @channel.password }
        - if params[:action] != 'new'
          = f.input :key, input_html: { disabled: true }
      .card-footer
        = f.button :submit
